<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<include file="Public:meta" />
</head>
<body id="main_page">
<include file="Public:position" />
<div class="container"> 
    <form enctype="multipart/form-data" id="frm"  method="post">
      <div class="table">
        <div class="toolbars">
            <li class="toolbar"><a id="btnBack" href="{$Url}Index" target="_self" title="返回">返回</a></li>
            <li class="toolbar"><a id="sortall" onclick="BatchSort()" title="批量排序">排序</a></li>
        </div>
        <table class="datatable" id="datatable">
        <tr>
            <th width="60"  nowrap="nowrap">字段ID</th>
            <th width="100" nowrap="nowrap">字段名称</th>
            <th width="100" nowrap="nowrap">字段类型</th>
            <th width="150" >显示名称</th>
            <th width="100" >显示类型</th>
            
            <th width="70" >字段排序</th>
            <th width="65" >是否验证</th>
            <th width="150" >验证规则</th>
            <th width="60" >属性</th>
            <th width="60" >是否启用</th>
            <th style="text-align:left;padding-left:20px">操作</th>
        </tr>
        <notempty name="Attribute">  
            <volist name="Attribute" id="c">
                <tr>
                    <eq name="c.GroupID" value="0">
                        <td colspan="5" style="text-align:left;padding-left:20px">
                            <span style="color:blue;font-weight:bold">{$c.DisplayName}</span>
                            <input type="hidden" name="AttributeID[]" value="{$c.AttributeID}" />
                        </td>
                        <td><input type="text" class='textinput'  onclick="this.select()" style="width:65px" name="DisplayOrder[]" value="{$c.DisplayOrder}" /></td>
                        <td colspan="2" style="text-align:right"></td>
                    <else/>
                        <td>{$c.AttributeID}<input type="hidden" name="AttributeID[]" value="{$c.AttributeID}" /></td>
                        <td>{$c.FieldName}</td>
                        <td>{$c.FieldType}</td>
                        <td>{$c.DisplayName}</td>
                        <td><b>{$c.DisplayTypeName}</b></td>  
                        <td><input type="text" class='textinput'  onclick="this.select()" style="width:65px" name="DisplayOrder[]" value="{$c.DisplayOrder}" /></td> 
                        <td><eq name="c.IsValidate" value="1"><span style="color:#000">验证</span></eq></td>
                        <td>{$c.ValidateRule}</td>
                    </eq>
                    <td><eq name="c.IsSystem" value="1"><span style="color:#000">系统</span><else/><span style="color:#F00">自定义</span></eq></td>
                    <td><eq name="c.IsEnable" value="1"><span style="color:#000">启用</span><else/><span style="color:#F00">禁用</span></eq></td>
                    <td class="operator">
                    	<a style="float:left" href="{$Url}ModifyField/ChannelModelID/{$c.ChannelModelID}/AttributeID/{$c.AttributeID}" id="btnEdit">修改</a>
                    </td>
                </tr>
            </volist>
        <else/>
            <tr><td colspan="11" id="NoData">{$Think.lang.NoDataTip}</td></tr>
        </notempty>                                  
        </table>
        <div class="tfoot">
          <div id="notice">
                <b>说明：</b><span class="notice-item"><span style="color:blue">蓝色</span>标题表示分组名称，最好不要修改属性为系统的字段！</span>
          </div>
        </div>
    </div>
    </form>
</div>
</body>
</html>
<script type="text/javascript">
//排序
function BatchSort(){
	$.confirm("{$Think.lang.SortTip}", function () {
		$('#frm').attr("action", "{$Url}batchSortField/ChannelModelID/{$ChannelModelID}");
		$('#frm').submit();
	}, function () {
		return true;
	});
}
</script>